<template>
  <div>
    <Dog1 v-for="(obj,index) in arr" :key="index" :imgurl="obj.Imgurl" :dogname="obj.dogName" @new='fn'></Dog1>
  <hr>
  <p>喜欢的狗狗</p>
  <ul>
    <li v-for="(item,index) in newArr" :key="index">{{item}}</li>
  </ul>
  </div>
  
</template>

<script>
import Dog1 from './components/Dog1.vue'
export default {
  data(){
    return {
      arr: [
    {
     dogImgUrl:
      "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
     dogName: "博美",
    },
    {
     dogImgUrl:
      "https://img0.baidu.com/it/u=2872058027,2680745347&fm=253&fmt=auto&app=138&f=JPEG?w=440&h=449",
     dogName: "泰迪",
    },
    {
     dogImgUrl:
      "https://img0.baidu.com/it/u=467567320,141065619&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=287",
     dogName: "金毛",
    },
    {
     dogImgUrl:
      "https://img0.baidu.com/it/u=3200238064,331094530&fm=253&fmt=auto&app=138&f=JPEG?w=440&h=564",
     dogName: "哈士奇",
    },
    {
     dogImgUrl:
      "https://img1.baidu.com/it/u=3238697659,2429015315&fm=253&fmt=auto&app=138&f=JPEG?w=330&h=350",
     dogName: "阿拉斯加",
    },
    {
     dogImgUrl:
      "https://img1.baidu.com/it/u=1383390785,4213593903&fm=253&fmt=auto&app=138&f=JPEG?w=593&h=450",
     dogName: "萨摩耶",
    },
   ],
   newArr:[]
    }
  },
  components:{
    Dog1,
  },
  methods:{
    fn(dogName) {
      this.newArr.push(dogName)
    }
  }
}
</script>

<style scoped>
</style>